﻿Imports System

Partial Public Class Helper
    ''' <summary>
    ''' Looks for key retruns segement after key segment.
    ''' </summary>
    ''' <param name="UrlLocalPath">Virtual Local Path</param>
    ''' <param name="key">String to find</param>
    ''' <returns>Segement after key segment</returns>
    Public Function FindInUrl(ByVal UrlLocalPath As [String], ByVal key As [String]) As [String]
        Dim result As [String] = ""
        Dim folders As [String]() = UrlLocalPath.Split("/"c)
        If folders.Length > 2 Then
            For i As Int32 = 0 To (folders.Length - 1) - 1
                If folders(i).ToLower().Trim() = key.ToLower().Trim() Then
                    result = folders(i + 1).Trim()
                End If
            Next
        End If
        Return result
    End Function
End Class